<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"> 

<h:head></h:head> 
<body> 
	<h:form id="search">
		<p:panel header="Cerca viaggio">
				<h:panelGrid columns="3">
				
					<h:outputLabel for="place">Destinazione*</h:outputLabel>
			        <h:selectOneMenu id="place" value="#{packetFrontend.placeId}" required="true" requiredMessage="Scegliere un luogo di destinazione">
                		<f:selectItem itemLabel="scegli una destinazione" itemValue="" />
                		<f:selectItems value="#{util.getPlaceListOptions()}" />
				    </h:selectOneMenu>
				    <p:message for="place" />
				    
				    <h:outputLabel for="startingDate">Data di inizio*</h:outputLabel>
					<p:calendar id="startingDate" binding="#{startDateComponent}" value="#{packetFrontend.startingDate}" pattern="MM/dd/yyyy" required="true" />
					<p:message for="startingDate" />
				    
				    <h:outputLabel for="endingDate">Data di fine*</h:outputLabel>
					<p:calendar id="endingDate" value="#{packetFrontend.endingDate}" pattern="MM/dd/yyyy" required="true">
					    <f:validator validatorId="dateRangeValidator" />
					    <f:attribute name="startDateComponent" value="#{startDateComponent}" />
					</p:calendar>
					<p:message for="endingDate" />
					
					<h:commandButton value="Cerca" action="#{packetFrontend.searchAction()}" />
				</h:panelGrid>
		</p:panel>
	</h:form>
	
		
	
</body> 
</html>
